<?php
    /**
     * Created by PhpStorm.
     * User: Administrator
     * Date: 2018/9/27
     * Time: 14:43
     */
namespace app\admin\model;

use app\admin\model\Room;


class GoldRoom extends DataBase
{
    // protected $pk =
    protected $name = 'gold_room';
    protected $autoWriteTimestamp = true;
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    public function getDataList()
    {

        $page_config = array(
            'page' => input('offset', 1),
            'list_rows' => input('limit', 10),
        );

        return $this
            ->alias('a')
            ->field('a.id,c.u_id,a.room_id,b.r_name,c.nickname')
            ->join('rooms b','a.room_id = b.id','left')
            ->join('users c','a.u_id = c.id','left')
            ->order('id desc')
            ->paginate($page_config);
    }
}